package bdr;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import dao.ArretDAO;

public class deIncercare {

	/**
	 * @param args
	 * @throws SQLException 
	 */
	public static void main(String[] args) throws SQLException {
		SGBD.connecter();
		List<String> l= new ArrayList<String>();
		
		String requete1 = "SELECT distinct Stops.stop_id, arrival_time, count(*) "
				+ " FROM Route,Trip,Stop_time,Stops "
				+ " WHERE route_short_name = '57'"
				+ " AND direction_id='0'"
				+ " AND Route.route_id=Trip.route_id"
				+ " AND Trip.trip_id=Stop_time.trip_id"
				+ " AND Stop_time.stop_id=Stops.stop_id"	
				+ " GROUP BY arrival_time, Stops.stop_id"
				+ " ORDER by arrival_time";

		ResultSet rs1 = SGBD.executeQuery(requete1);
		rs1.next();
		
		
		
		ArretDAO ad=new ArretDAO();
		
		System.out.println(ad.find("1501").getNom());
		SGBD.fermer();

	}

}
